package com.maimao.model.cart;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.maimao.model.info.MgCoupon;
import org.springframework.data.annotation.Transient;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 前端购物车展示实体
 *
 * @author MaoLin Wang
 * @date 2021/1/10 8:39 下午
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ShoppingCartVo implements Serializable {

    private static final long serialVersionUID = -917405537564551170L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long shopId;
    /**
     * 店铺名称
     */
    private String name;

    /**
     * 优惠券信息 前端使用的表格组件的原因，需要在店铺行的规格列specStr位置展示优惠券信息 商品行还是展示规格信息
     */
    private List<MgCoupon> specStr;

    /**
     * 当前店铺中的商品最新的添加时间
     */
    private LocalDateTime latestTime;

    private List<ShoppingCart> children;

    @Override
    public String toString() {
        return "ShoppingCartVo{" +
                "shopId=" + shopId +
                ", name='" + name + '\'' +
                ", specStr=" + specStr +
                ", latestTime=" + latestTime +
                ", children=" + children +
                '}';
    }

    public List<MgCoupon> getSpecStr() {
        return specStr;
    }

    public void setSpecStr(List<MgCoupon> specStr) {
        this.specStr = specStr;
    }

    public LocalDateTime getLatestTime() {
        return latestTime;
    }

    public void setLatestTime(LocalDateTime latestTime) {
        this.latestTime = latestTime;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<ShoppingCart> getChildren() {
        return children;
    }

    public void setChildren(List<ShoppingCart> children) {
        this.children = children;
    }
}
